package com.cqie.tes.mapper;

import com.cqie.tes.domain.Result;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.cqie.tes.domain.vo.tes.evalute.result.RdVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author DD-GKD
 * @since 2020-09-18
 */
@Mapper
public interface ResultMapper extends BaseMapper<Result> {
    @Select("SELECT\n" +
            "        Count(tes_result.teacherId) AS count,\n" +
            "        Avg(tes_result.score) AS avg,\n" +
            "        tes_result.taskId,\n" +
            "        tes_result.teacherId,\n" +
            "        tes_result.typeId\n" +
            "        FROM\n" +
            "        tes_result\n" +
            "        GROUP BY\n" +
            "        tes_result.taskId,\n" +
            "        tes_result.typeId,\n" +
            "        tes_result.teacherId")
    List<RdVo> selectResult();
}
